package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据菜品id查询对应的套餐id
     * @param dishIds
     * @return
     */
    List<Long> getSetmealByDishIds(List<Long> dishIds);

    /**
     * 套餐菜品关系添加
     * @param setmealDishes
     */
    void insert(List<SetmealDish> setmealDishes);

    /**
     * 套餐与菜品关系的批量删除
     * @param setmealIds
     */
    void deleteSetmealWithDishByIds(List<Long> setmealIds);

    /**
     * 根据id查询套餐与菜品关系
     * @param setmealId
     * @return
     */
    @Select("select * from sky_take_out.setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getSetmealWithDishById(Long setmealId);
}
